package com.tian.source.mapper;

import com.tian.core.base.mapper.BaseMapper;
import com.tian.core.page.Page;
import com.tian.source.model.Department;
import com.tian.source.model.vo.DepartmentVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author YangTao
 * @date 2025/4/18
 */
@Mapper
@Component(value = "departmentMapper")
public interface DepartmentMapper extends BaseMapper<Department> {

    /**
     * 通过名称查询部门
     * @param department
     * @return
     */
    Integer findDepartmentByName(@Param(value = "department") Department department);

    /**
     * 查询所有部门并分页
     * @param page
     * @param
     * @return
     */
    Page<List<DepartmentVo>> findDepartmentByPage(@Param(value = "page") Page page, @Param(value = "department") Department department);

}
